# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
@tagkeyup=(obj)->
  $.ajax "/tags?pre="+$(obj).val(),
    dataType:'html'
    success:(data,textStatus,jqXHR)->
      if data.stat==undefined
        $('.tag-hint').html data

@selectTag=(obj)->
  $('.tag-id').val($(obj).html())
  $('.tag-hint').html('')
